package com.estate.common.core.domain.model.listing;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * 房产特性信息模型
 *
 * @author estate
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Feature implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 卫生间数量
     */
    private Integer bathrooms;

    /**
     * 露天车位数量
     */
    @JsonProperty("car_open_spaces")
    private Integer carOpenSpaces;

    /**
     * 车位数量
     */
    @JsonProperty("car_spaces")
    private Integer carSpaces;

    /**
     * 车库数量
     */
    private Integer garages;

    /**
     * 其他特性描述
     */
    private String other;

    /**
     * 卧室数量
     */
    private Integer bedrooms;

    /**
     * 车位数量（car ports）
     */
    @JsonProperty("car_ports")
    private Integer carPorts;

    /**
     * 建筑信息
     */
    private Building building;

    /**
     * 土地信息
     */
    private Land land;

    /**
     * 设施配置信息
     */
    private Has has;

    // ========== 内部类定义 ==========

    /**
     * 建筑信息
     */
    @Data
    public static class Building implements Serializable {
        private static final long serialVersionUID = 1L;

        /**
         * 建筑面积
         */
        private String area;

        /**
         * 面积单位
         */
        private String unit;
    }

    /**
     * 土地信息
     */
    @Data
    public static class Land implements Serializable {
        private static final long serialVersionUID = 1L;

        /**
         * 土地面积
         */
        private String area;

        /**
         * 面积单位
         */
        private String unit;
    }

    /**
     * 设施配置信息
     */
    @Data
    public static class Has implements Serializable {
        private static final long serialVersionUID = 1L;

        // 网络与通信
        private Boolean broadband;
        private Boolean paytv;
        private Boolean intercom;

        // 水疗与泳池设施
        @JsonProperty("outside_spa")
        private Boolean outsideSpa;
        @JsonProperty("inside_spa")
        private Boolean insideSpa;
        private Boolean spa;
        private Boolean pool;
        @JsonProperty("pool_above_ground")
        private Boolean poolAboveGround;
        @JsonProperty("pool_in_ground")
        private Boolean poolInGround;

        // 房间与布局
        private Boolean ensuite;
        private Boolean study;
        private Boolean bir;
        private Boolean courtyard;
        private Boolean deck;

        // 冷暖系统
        private Boolean aircon;
        @JsonProperty("split_system_aircon")
        private Boolean splitSystemAircon;
        @JsonProperty("evaporative_cooling")
        private Boolean evaporativeCooling;
        @JsonProperty("ducted_cooling")
        private Boolean ductedCooling;
        private Boolean heating;
        @JsonProperty("split_system_heating")
        private Boolean splitSystemHeating;
        @JsonProperty("ducted_heating")
        private Boolean ductedHeating;
        @JsonProperty("hydronic_heating")
        private Boolean hydronicHeating;
        @JsonProperty("fire_place")
        private Boolean firePlace;

        // 安全与便利设施
        private Boolean alarm;
        private Boolean pets;
        private Boolean shed;
        @JsonProperty("tennis_court")
        private Boolean tennisCourt;
        private Boolean gym;

        // 家居设施
        private Boolean dishwasher;
        private Boolean floorboards;
        private Boolean furnished;
    }
}